package com.baidu.mapapi;

import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.Canvas;

final class k
{
  private Bitmap a = null;
  private Canvas b = null;
  private Bitmap.Config c;

  public k(Bitmap.Config paramConfig)
  {
    this.c = paramConfig;
  }

  public final void a()
  {
    if (this.a != null)
      this.a.recycle();
    this.a = null;
    this.b = null;
  }

  public final void a(int paramInt1, int paramInt2)
  {
    a();
    this.a = Bitmap.createBitmap(paramInt1, paramInt2, this.c);
    this.b = new Canvas(this.a);
  }

  public final void a(l paraml)
  {
    this.b.save(1);
    paraml.a(this.b);
    this.b.restore();
  }

  public final Bitmap b()
  {
    return this.a;
  }
}